import report from './axios'
//登录
export const logins=(obj)=>report.post('login',obj);
// 菜单栏
export const menus=()=>report.get('menus');
// 用户列表
export const users=(obj)=>report.get('users',{
    params:obj
})
//用户列表的状态修改
export const state=(uId,type)=>report.put(`users/${uId}/state/${type}`)
//用户列表添加
export const adduser=(obj)=>report.post('users',obj)
//删除用户
export const deluser=(id)=>report.delete(`users/${id}`)
//修改用户
export const deituser=(obj)=>report.put(`users/${obj.id}`,obj)
//用户回填数据
export const huiuser=(id)=>report.get(`users/${id}`)
// 角色列表数据
export const roles=(obj)=>report.get('roles',{
    params:obj
})
// 角色添加
export const rolesadd=(obj)=>report.post(`roles`,obj)
//删除角色
export const delroles=(id)=>report.delete(`roles/${id}`)
//角色回填
export const huiroles=(id)=>report.get(`roles/${id}`)
//角色修改
export const editroles=(obj)=>report.put(`roles/${obj.id}`,obj)
//删除指定角色
export const roleszhi=(roleId,rightId)=>report.delete(`roles/${roleId}/rights/${rightId}`)
//角色授权
export const rolesgrant=(roleId,rids)=>report.post(`roles/${roleId}/rights`,{rids})
//角色列表权限
export const roleslist=()=>report.get('rights/tree')
//权限列表
export const rights=()=>report.get(`rights/list`)
